package com.baox.agridata.synchronous.controller;

import com.baox.agridata.synchronous.entity.*;
import com.baox.agridata.synchronous.result.Result;
import com.baox.agridata.synchronous.service.AsyncCertificateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 接收成都发往四川数据的Controller（主要接收检疫证数据）
 */
@RestController
@Slf4j
@RequestMapping("/receive")
public class ReceiveChengDuDataController {


    @Autowired
    private AsyncCertificateService asyncCertificateService;


    @RequestMapping(value = "/ChengduTCCAB", method = RequestMethod.POST)
    public Result receiveChengduTCCAB(@RequestBody List<TCCABEntity> l_list) {
        return asyncCertificateService.dealReceiveListAnimalBData(l_list);
    }


    @RequestMapping(value = "/ChengduTCCAA", method = RequestMethod.POST)
    public Result receiveChengduTCCAA(@RequestBody List<TCCAAEntity> l_list) {
        return asyncCertificateService.dealReceiveListAnimalAData(l_list);
    }


    @RequestMapping(value = "/ChengduTCCPB", method = RequestMethod.POST)
    public Result receiveChengduTCCPB(@RequestBody List<TCCPBEntity> l_list) {
        return asyncCertificateService.dealReceiveListProductBData(l_list);
    }

    @RequestMapping(value = "/ChengduTCCPA", method = RequestMethod.POST)
    public Result receiveChengduTCCPA(@RequestBody List<TCCPAEntity> l_list) {
        return asyncCertificateService.dealReceiveListProductAData(l_list);
    }


    //-------------------------------落地反馈数据接收
    @RequestMapping(value = "/ChengduLandingFeedbackTCCAB", method = RequestMethod.POST)
    public Result ChengduLandingFeedbackTCCAB(@RequestBody List<TCCABEntity> l_list) {   //接收成都的动物B数据(落地反馈的数据)
        return asyncCertificateService.dealReceiveChengduLandingFeedbackTCCAB(l_list);
    }

    @RequestMapping(value = "/ChengduLandingFeedbackTCCOutAA", method = RequestMethod.POST)
    public Result ChengduLandingFeedbackTCCOutAA(@RequestBody List<TCCOutAAEntity> l_list) {   //接收成都的动物B数据(落地反馈的数据)
        return asyncCertificateService.dealReceiveChengduLandingFeedbackTCCOutAA(l_list);
    }



//    @RequestMapping(value = "/ChengduLandingFeedbackTCCPB", method = RequestMethod.POST)
//    public Result ChengduLandingFeedbackTCCPB(@RequestBody List<TCCPBEntity> l_list) {   //接收成都的产品B数据(落地反馈数据)
//        asyncCertificateService.dealReceiveChengduLandingFeedbackTCCPB(l_list);
//        return Result.ok();
//    }
//
//
//    @RequestMapping(value = "/ChengduLandingFeedbackTCCOutPA", method = RequestMethod.POST)
//    public Result ChengduLandingFeedbackTCCOutPA(@RequestBody List<TCCOutPAEntity> l_list) {   //接收成都的动物B数据(落地反馈的数据)
//        asyncCertificateService.dealReceiveChengduLandingFeedbackTCCOutPA(l_list);
//        return Result.ok();
//    }
}
